raw_data = ["  hello  ", "WORLD", "  Python  ", "PROGRAMMING"]

clean_data = [data.strip().lower() for data in raw_data]

print("clean_data=", clean_data)

# 提取数字# [100.0, 2.5, 25.0]
text_lines = ["Price: $100", "Weight: 2.5kg", "Count: 25 items"]

# [' $100', ' 2.5kg', ' 25 items']
split_list = [
    float("".join(c for c in line if c.isdigit() or c == "."))
    for line in text_lines
    if any(c.isdigit() for c in line)
]

print("split_list=", split_list)
